Skip to content

Inline monomorphic methods in optimized Lua - #1296

Merged
Frotty merged 2 commits into
masterfrom
codex/lua-monomorphic-method-inlining
Sep 4, 2026
Merged

Inline monomorphic methods in optimized Lua#1296
Frotty merged 2 commits into
masterfrom
codex/lua-monomorphic-method-inlining

Conversation

@Frotty

@Frotty Frotty commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

  • lower monomorphic method calls inside Lua hot loops to ordinary IM function calls before inlining
  • reuse the backend's existing direct-call predicate in vararg lowering and final emission
  • preserve callback, local-player, recursion, register-pressure, and genuine virtual-dispatch boundaries
  • keep calls outside loops in their established representation to avoid broad code-shape churn

Acceptance criteria

  • tiny monomorphic methods disappear from optimized Lua hot loops
  • receivers are evaluated exactly once
  • callback/function-reference and local-player-sensitive methods keep their call boundaries
  • abstract/overridden and virtually dispatched vararg methods retain dispatch
  • the existing UnitSpatialIndex loop still emits raw table accesses without assurance, vararg-pack, or arithmetic-helper overhead

Checks

  • PASS: focused 10-test LuaBackendAuditTests matrix covering the new behavior, Jass/Lua receiver parity, callback and local-player barriers, fixed and dynamic varargs, virtual dispatch, and UnitSpatialIndex emitted shape
  • PASS: complete LuaTranslationTests class (114 tests)
  • PASS: GitHub Actions full Gradle build and test suite
  • PASS: git diff --check

Review

  • Codex review completed cleanly on head 4da675e9dc with no inline findings or unresolved threads.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T16:47:28.470555Z 4da675e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Frotty

Frotty commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

CI exposed broad optimized-output shape churn outside hot loops. I restricted the lowering to monomorphic calls structurally inside IM loops; the full LuaTranslationTests class (114 tests) and the focused Lua backend matrix now pass locally. @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 4da675e9dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Frotty
Frotty merged commit b776cf9 into master Sep 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant